import request from "@/utils/request";

/* 获取所有在学学生列表 */
export function courseStuList(params) {
  return request({
    url: "/school/teacher/learningInfoPage/courseStuList",
    method: "get",
    params: params,
  });
}

// 课程在学学生列表-小组模式
export function studentStudyListByGroup(courseSchedulingId, sortType) {
  return request({
    url: `/school/teacher/teachingPage/studentStudyListByGroup/${courseSchedulingId}/${sortType}`,
    method: "get",
  });
}
// 在学学生列表-----正常模式
export function finishCourse(courseSchedulingId) {
  return request({
    url: `/school/teacher/teachingPage/finishCourse/${courseSchedulingId}`,
    method: "post",
  });
}
// 在学学生列表-----正常模式
export function getStudentStudyList(courseSchedulingId, sortType) {
  return request({
    url: `/school/teacher/teachingPage/studentStudyList/${courseSchedulingId}/${sortType}`,
    method: "get",
  });
}
// 获取课程类型
export function course_type() {
  return request({
    url: `/system/dict/data/type/course_type`,
    method: "get",
  });
}
// 首页数据
export function homepage(data) {
  return request({
    url: "/school/student/homepage",
    method: "get",
    params: data,
  });
}
// 每日完成步骤
export function daily() {
  return request({
    url: `/school/student/homepage/daily`,
    method: "get",
  });
}
// 获取学习中课程列表
export function learningCourseList(studentId,query) {
  return request({
    url: "/school/student/courseStudyManager/learningCourseList/" + studentId,
    method: "get",
    params: query,
  });
}
// 获取可报名课程列表
export function selectCourseList(studentId) {
  return request({
    url: `/school/student/courseStudyManager/selectCourseList/${studentId}`,
    method: "get",

  });
}
// 课程-报名
export function selectCourse(courseSchedulingId,studentId) {
  return request({
    url: `/school/student/courseStudyManager/selectCourse/${courseSchedulingId}/${studentId}`,
    method: "post"
  });
}
// 获取学习主页信息(详细的课程详情)
export function homeCourseInfo(courseSchedulingId) {
  return request({
    url: `/school/student/courseStudyManager/courseInfo/${courseSchedulingId}`,
    method: "get",
  });
}
// 获取目录信息
export function getIndexStudyInfo(courseStuId,indexId) {
  return request({
    url: `/school/student/courseStudyManager/indexStudyInfo/${courseStuId}/${indexId}`,
    method: "get",
  });
}
// 获取课程学习记录详情
export function getCourseStudyInfo(courseStuId) {
  return request({
    url: `/school/student/courseStudyManager/courseStudyInfo/${courseStuId}`,
    method: "get",
  });
}
// 课程开始学习
export function startLearning(courseSchedulingId, studentId) {
  return request({
    url: `/school/student/courseStudyManager/startLearning/${courseSchedulingId}/${studentId}`,
    method: "post",
  });
}
// 获取拉人学员列表
export function getOutsideStudentList(courseSchedulingId) {
  return request({
    url: `/school/teacher/teachingPage/studentList/${courseSchedulingId}`,
    method: "get",
  });
}
// 课程添加学生
export function putCourseStudentList(courseSchedulingId, studentIds,recoverStudyRecord) {
  return request({
    url: `/school/teacher/teachingPage/putCourseStudentList/${courseSchedulingId}/${studentIds}/${recoverStudyRecord}`,
    method: "post",
  });
}
// 课程目录列表————学生
export function studentStudyIndexList(courseStuId) {
  return request({
    url: `/school/teacher/learningInfoPage/studentStudyIndexList/${courseStuId}`,
    method: "get"
  });
}
// 学习数据
export function getStudyData() {
  return request({
    url: `/school/student/mineData/studyData`,
    method: "get",
  });
}

// 课程数据
export function getCourseData(semesterId,params) {
  return request({
    url: `/school/student/mineData/courseData/${semesterId}`,
    method: "get",
    params
  });
}

//获取评价学生信息列表
export function getEvaluateStudentList(courseSchedulingId, params) {
  return request({
    url: `/school/teacher/teachingPage/evaluateStudentList/${courseSchedulingId}`,
    method: "get",
    params: params,
  });
}
// 获取学生列表
export function getStudentSearchList(courseSchedulingId) {
  return request({
    url: `/school/teacher/teachingPage/studentSearchList/${courseSchedulingId}`,
    method: "get",
  });
}
//修改学生评价
export function submitEvaluate(data) {
  return request({
    url: `/school/teacher/teachingPage/evaluateStudent`,
    method: "post",
    data: data,
  });
}

//学生评价详情
export function getEvaluateInfo(courseStuId) {
  return request({
    url: `/school/teacher/teachingPage/evaluateInfo/${courseStuId}`,
    method: "get",
  });
}

// 获取课程工作站列表
export function sys_course_type() {
  return request({
    url: `/school/system/dict/data/type/sys_course_type`,
    method: "get",
  });
}
// 获取学生任务进度-左侧学生信息
export function teaStudentInfo(courseStuId) {
  return request({
    url: `/school/teacher/learningInfoPage/studentBaseInfo/${courseStuId}`,
    method: "get",
  });
}

// 重置学生学习进度
export function resetLearningProgress(courseStuId) {
  return request({
    url: `/school/teacher/learningInfoPage/resetLearningProgress/${courseStuId}`,
    method: "post",
  });
}
// 学生完成剩余课程
export function finishResidualIndex(courseStuId, score) {
  return request({
    url: `/school/teacher/learningInfoPage/finishResidualIndex/${courseStuId}/${score}`,
    method: "post",
  });
}
// 重置密码
export function resetPassword(studentId) {
  return request({
    url: `/school/teacher/learningInfoPage/resetPassword/${studentId}`,
    method: "post",
  });
}
// 课程推荐-查询列表 manager:courseRecommend:list
export function getCourseRecommend(params) {
  return request({
    url: `/school/manager/courseRecommend/list`,
    method: "get",
    params: params,
  });
}
// 课程-查询列表 manager:courseRecommend:list
export function getCourseRecommendCourseList(params) {
  return request({
    url: `/school/manager/courseRecommend/courseList`,
    method: "get",
    params: params,
  });
}
// 课程推荐-新增 manager:courseRecommend:add
export function addCourseRecommend(data) {
  return request({
    url: `/school/manager/courseRecommend/addCourseRecommend`,
    method: "post",
    data: data,
  });
}
// 课程推荐-置顶 manager:courseRecommend:update
export function editCourseRecommend(data) {
  return request({
    url: `/school/manager/courseRecommend/editCourseRecommend`,
    method: "post",
    data: data,
  });
}
// 隐藏显示课程
export function needHideCourseRecommend(courseId, hide) {
  return request({
    url: `/school/manager/courseRecommend/courseHide/${courseId}/${hide}`,
    method: "post",
  });
}
// 课程推荐-删除 manager:courseRecommend:delete
export function deleteCourseRecommend(id) {
  return request({
    url: `/school/manager/courseRecommend/${id}`,
    method: "delete",
  });
}

// 课程推荐-排序 manager:courseRecommend:sort
export function sortCourseRecommend(data) {
  return request({
    url: `/school/manager/courseRecommend/sort`,
    method: "post",
    data: data,
  });
}

// 踢出学生
export function kickOutStudent(courseStuId) {
  return request({
    url: `/school/teacher/learningInfoPage/kickOutStudent/${courseStuId}`,
    method: "post",
  });
}

// 获取学生所有课程列表
export function getAllCourseList(studentId,params) {
  return request({
    url: `/school/student/courseStudyManager/allCourseList/${studentId}`,
    method: "get",
    params: params,
  });
}

// 预览文件获取token接口
export function getWebOfficeToken(params) {
  return request({
    url: `/school/file/generateWebOfficeToken`,
    method: "get",
    params: params,
  });
}
